/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package picounit.features.classloader.mutator;

import moved.org.objectweb.asm.Opcodes;

public class Access {
	private final int access;

	public Access(int access) {
		this.access = access;
	}

	public boolean isPublic() {
		return hasFlag(Opcodes.ACC_PUBLIC);
	}

	public boolean isStatic() {
		return hasFlag(Opcodes.ACC_STATIC);
	}
	
	///////////////////////////////////////////////////////////////////////////////////////////////
	// Implementation methods
	///////////////////////////////////////////////////////////////////////////////////////////////

	private boolean hasFlag(int flag) {
		return (flag & access) != 0;
	}
}